package com.maguangwu.controller;

import com.maguangwu.constant.MessageConstant;
import com.maguangwu.entity.PageResult;
import com.maguangwu.entity.QueryPageBean;
import com.maguangwu.entity.Result;
import com.maguangwu.pojo.CheckGroup;
import com.maguangwu.server.CheckGroupService;
import com.maguangwu.server.impl.CheckGroupServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.awt.*;
import java.util.List;

/**
 * @author mgw
 * @create 2021/10/31 9:49
 */
@RestController
@RequestMapping("/checkGroup")
public class CheckGroupController {
    @Resource(name="checkGroup")
    private CheckGroupService checkGroup;

    @PostMapping("/findPage")
    public Result checkGrouoFindPage(@RequestBody QueryPageBean queryPageBean) {
        PageResult<CheckGroup> checkGroupList = checkGroup.checkGrouoFindPage(queryPageBean);
        return new Result(true, MessageConstant.GET_SETMEAL_LIST_SUCCESS,checkGroupList);
    }
    @PostMapping("/add")
    public Result addCheckGroup(@RequestParam int[] checkitemIds,@RequestBody CheckGroup checkGroups){
        checkGroup.addCkeckGroup(checkitemIds,checkGroups);
        return new Result(true,MessageConstant.ADD_CHECKGROUP_SUCCESS);
    }
}
